<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    var arr=new Array();
for(var i=0;i<4;i++){
    arr[i]=f1(i);
}
    function  f1(n){
        console.log(n);
        return f2;
    }
    arr[0]();
    arr[1]();
    arr[2]();
    arr[3]();
</script>
</body>
</html>